﻿using System;

namespace problem_2
{
    class Program
    {
        static void Main(string[] args)
        {
            var value = 0;
            var i = 1;
            var sum = 0;
            while (value < 4000000)
            {
                Console.Clear();
                
                value = Fibonacci.Value(i);
                if (value % 2 == 0)
                    sum += value;
                i++;
            }

            Console.WriteLine("Project Euler - Problem #2");
            Console.WriteLine("\r\n\tFind the sum of all the even-valued terms\r\n\tin the Fibonacci sequence which do not\r\n\texceed four million.\r\n");
            Console.WriteLine(string.Format("Answer: {0:0,0}", sum));
        }
    }
}
